<?php 
  require_once("includes/config.php"); 
  
  $sql = 'SELECT * FROM clients where owner_id = ?';

  $binds = array();
  
  $binds['owner_id'] = $_SESSION['user_id'];

  if(isset($_GET['identification'])) 
  {
    if(!empty($binds))
      $and = " and ";
    else
      $and = " ";
           
    $binds['id'] = $_GET['apart_id'];
    $sql .= $and."apartments.id  = ?";
    $sqlCount .= $and."apartments.id  = ?";
  } 
                
    
  //dump($sql);
  $clients = query($sql,$binds);
    
  require("Contract_pops/choose_client.php");
?>